﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls.CommonTables.CQ.CQFY
{
    /// <summary>
    /// ShouShuShouFei.xaml 的交互逻辑
    /// </summary>
    public partial class ShuHouZhengTongCtrl : CustomCommonTableCtrl
    {
        public ShuHouZhengTongCtrl()
        {
            InitializeComponent();
            bjjl.Value = "2";
            zjjl.Value = "0.5";
            IniteRadioBation();
            this.Loaded += thisCtrl_Loaded;
        }


        private void thisCtrl_Loaded(object sender, RoutedEventArgs e)
        {
            DataManager.Instance.IsNotNeedSaveData = false;
        }

        private void kssj_GotFocus(object sender, RoutedEventArgs e)
        {
            CustomTextCtrl cusCtrl = sender as CustomTextCtrl;
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;
            cusDatePicker.ShowDialog();
            if (cusDatePicker.Result)
            {
                cusCtrl.Value = cusDatePicker.SelectedDateTime.ToString(DateFormat.DATE_FORMAT_STR_YMDHM_CN);//xxxx年xx月xx日
            }
        }
        private void jssj_GotFocus(object sender, RoutedEventArgs e)
        {
            CustomTextCtrl cusCtrl = sender as CustomTextCtrl;
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;
            cusDatePicker.ShowDialog();
            if (cusDatePicker.Result)
            {
                cusCtrl.Value = cusDatePicker.SelectedDateTime.ToString(DateFormat.DATE_FORMAT_STR_YMDHM_CN);//xxxx年xx月xx日
            }
        }

        private void rq1_GotFocus(object sender, RoutedEventArgs e)
        {
            CustomTextCtrl cusCtrl = sender as CustomTextCtrl;
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;
            cusDatePicker.ShowDialog();
            if (cusDatePicker.Result)
            {
                cusCtrl.Value = cusDatePicker.SelectedDateTime.ToString(DateFormat.DATE_FORMAT_STR_YMD_CN);//xxxx年xx月xx日
            }
        }
        private void IniteRadioBation()
        {
            new RadioButtonHelper().ChangeRadioSatus(zyys, zzys, zrys, fzrys);
        }
    }
}
